/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nxlv2.nomad.view.ficheClient;

import com.nxlv2.nomad.businessobjects.Utilisateur;
import com.nxlv2.nomad.view.Welcome;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Nastasia
 */
public class CreateClient extends javax.swing.JFrame {
    private final Utilisateur user;
    private final Welcome welcome;

    /**
     * Creates new form CreateClient
     */
    public CreateClient(Utilisateur user, Welcome welcome) {
        initComponents();
        this.user = user;
        this.welcome=welcome;
        setLocationRelativeTo(null);
        initData();
    }
    
    /**
     * Initialisation informations
     */
    public void initData() {
        lblError.setText(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        txtNomClient = new javax.swing.JTextField();
        lblNomClient = new javax.swing.JLabel();
        btnAjoutClient = new javax.swing.JButton(new CreateClientAction(this));
        lblError = new javax.swing.JLabel();
        lblError1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Formulaire de création client");

        lblNomClient.setText("Nom Client* :");

        btnAjoutClient.setText("Ajouter");

        lblError.setForeground(new java.awt.Color(255, 0, 0));
        lblError.setText("jLabel16");

        lblError1.setText("* Champs obligatoires");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblError1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lblNomClient)
                        .addGap(18, 18, 18)
                        .addComponent(txtNomClient, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnAjoutClient))
                    .addComponent(lblError, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNomClient, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNomClient)
                    .addComponent(btnAjoutClient))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblError1)
                .addGap(3, 3, 3)
                .addComponent(lblError)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAjoutClient;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lblError;
    private javax.swing.JLabel lblError1;
    private javax.swing.JLabel lblNomClient;
    private javax.swing.JTextField txtNomClient;
    // End of variables declaration//GEN-END:variables

    public Utilisateur getUser() {
        return user;
    }

    public JTextField getTxtNomClient() {
        return txtNomClient;
    }

    public JLabel getLblError() {
        return lblError;
    }


    public JLabel getLblNomClient() {
        return lblNomClient;
    }


    public Welcome getWelcome() {
        return welcome;
    }

}
